Skip to content

Conversation

@zverok
Copy link
Contributor

@zverok zverok commented Mar 10, 2019

This PR updates FileUtils docs. Initially, I just started to fix wrong example of usage of cp_r, which started with:

FileUtils.rm_r site_ruby + '/mylib', :force # doesn't work, should be force: true

...but then I reviewed the whole module docs and did the following changes:

  • updated all code examples to use keyword args instead of hashrocket syntax;
  • hidden some of internal constants and modules;
  • made "See also" links linkable (see, for example, rm_rf -- it says "Read the documentation of rm_r first.", but rm_r isn't linked, because in docs source it should be documentation of rm_r or documentation of ::rm_r, not documentation of #rm_r);
  • added a bit more explanations to some places (for example, currently introduction says "The options parameter is a hash of options, taken from the list :force, :noop, :preserve, and :verbose. :noop means that no changes are made. The other three are obvious." -- I believed that they are not :))
  • (not sure about it) unhidden methods FileUtils::commands, FileUtils::options and several others -- considering they call-seq and docs, they've meant to be public.

PS: I believe it makes sense to change everywhere default value from verbose: nil to noop: false (for all keyword args), because nil for a boolean option intuitively reads like a "possible third option" (like "true is totally verbose, false is totally silent, nil is some reasonable defaults").

@hsbt hsbt merged commit 106ddaa into ruby:master Jul 14, 2019
@zverok zverok deleted the update-docs branch August 11, 2019 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants